package chooongg.base.loadState.callback

import android.content.Context
import android.content.Intent
import android.provider.Settings
import android.view.View
import android.widget.TextView
import chooongg.base.R
import chooongg.base.manager.app

class NetworkCallback : Callback() {
    override fun onReloadEvent(): View? = obtainRootView().findViewById(R.id.btn_refresh)

    override fun getViewLayout() = R.layout.state_network
    override fun onViewCreated(context: Context, view: View) {
        view.findViewById<TextView>(R.id.btn_other)?.setOnClickListener {
            app.startActivity(Intent(Settings.ACTION_SETTINGS).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
        }
    }

    override fun onAttach(context: Context, view: View) = Unit

    override fun getMessageView(): TextView? = obtainRootView().findViewById(R.id.tv_message)

    override fun onDetach(context: Context, view: View) = Unit


}